﻿'Params
'timestamp[i] (Required) : The time the track started playing, in UNIX timestamp format (integer number of seconds since 00:00:00, January 1st 1970 UTC). This must be in the UTC time zone.
'album[i] (Optional) : The album name.
'track[i] (Required) : The track name.
'artist[i] (Required) : The artist name.
'albumArtist[i] (Optional) : The album artist - if this differs from the track artist.
'duration[i] (Optional) : The length of the track in seconds.
'streamId[i] (Optional) : The stream id for this track received from the radio.getPlaylist service, if scrobbling Last.fm radio
'chosenByUser[i] (Optional) : Set to 1 if the user chose this song, or 0 if the song was chosen by someone else (such as a radio station or recommendation service). Assumes 1 if not specified
'context[i] (Optional) : Sub-client version (not public, only enabled for certain API keys)
'trackNumber[i] (Optional) : The track number of the track on the album.
'mbid[i] (Optional) : The MusicBrainz Track ID.
'api_key (Required) : A Last.fm API key.
'api_sig (Required) : A Last.fm method signature. See authentication for more information.
'sk (Required) : A session key generated by authenticating a user via the authentication protocol.
'    Auth()
'This service requires authentication. Please see our authentication how-to.
'This is a write service and must be accessed with an HTTP POST request. All parameters should be sent in the POST body, including the 'method' parameter. See rest requests for more information. 

Public Structure TrackScrobbleResponse

End Structure

Public Class TrackScrobble
	Inherits BaseRequest
    Dim artist As String = ""
    Dim album As String = ""
    Dim mbid As String = ""
    Dim lang As String = ""
    Dim autocorrect As String = ""
    Dim page As String = ""
    Dim limit As String = ""

	Public xmlresponse As XDocument = Nothing

	Public Sub New()
        Me.artist = artist
        Me.album = album
        Me.mbid = mbid
        Me.lang = lang
        Me.autocorrect = autocorrect
        Me.page = page
        Me.limit = limit
	End Sub

	Public Sub sendRequest()
        InitializeMembers("album.getInfo")
        AddMember("artist", artist, String.IsNullOrEmpty(mbid))
        AddMember("album", album, String.IsNullOrEmpty(mbid))
        AddMember("mbid", mbid, False)
        AddMember("lang", lang, False)
        AddMember("autocorrect", autocorrect, False)
		AddMember("username", My.Settings.user_name, False)
        AddMember("api_key", My.Settings.api_key, False)

        xmlresponse = sendPOSTResponse(True)
	End Sub

    Public Function getResponse() As TrackScrobbleResponse
        Dim response As New TrackScrobbleResponse
        'response.album = New Album(xmlresponse.<lfm>.<album>.First)
        Return response
    End Function
End Class
